import BaseEntity from './BaseEntity.mjs'

/**
 * 作品
 */
export default class Works extends BaseEntity {
    /**
     * 作品来源站点id
     * @type { number | undefined | null}
     */
    siteId
    /**
     * 站点中作品的id
     * @type { string | undefined | null}
     */
    siteWorksId
    /**
     * 站点中作品的名称
     * @type { string | undefined | null}
     */
    siteWorksName
    /**
     * 站点中作品的作者id
     * @type { string | undefined | null}
     */
    siteAuthorId
    /**
     * 站点中作品的描述
     * @type { string | undefined | null}
     */
    siteWorkDescription
    /**
     * 站点中作品的上传时间
     * @type { number | undefined | null}
     */
    siteUploadTime
    /**
     * 站点中作品最后修改的时间
     * @type { number | undefined | null}
     */
    siteUpdateTime
    /**
     * 作品别称
     * @type { string | undefined | null}
     */
    nickName
    /**
     * 最后一次查看的时间
     * @type { number | undefined | null}
     */
    lastView

    /**
     * @param works : Works
     */
    constructor(works) {
        if (works === undefined) {
            super()
            this.siteId = undefined
            this.siteWorksId = undefined
            this.siteWorksName = undefined
            this.siteAuthorId = undefined
            this.siteWorkDescription = undefined
            this.siteUploadTime = undefined
            this.siteUpdateTime = undefined
            this.nickName = undefined
            this.lastView = undefined
        } else {
            super(works)
            this.siteId = works.siteId
            this.siteWorksId = works.siteWorksId
            this.siteWorksName = works.siteWorksName
            this.siteWorkDescription = works.siteWorkDescription
            this.siteAuthorId = works.siteAuthorId
            this.siteUploadTime = works.siteUploadTime
            this.siteUpdateTime = works.siteUpdateTime
            this.nickName = works.nickName
            this.lastView = works.lastView
        }
    }
}
